<?php
namespace app\appin\service;

class Command extends BaseService
{
	public static function getFacadeName()
	{
		return 'Command';
	}
	
	/**
	 * 自动加载命令行
	 */
	public function autoload( $command = [] )
	{
		$appin = Package::allAppin();
		if ( ($count = count($appin)) > 0 ) {
			for( $i = 0; $i < $count; $i++ ) {
				$appinCnf = Package::load($appin[$i]);
				if ( isset($appinCnf['command']) && !empty($appinCnf['command'])) {
					$command = array_merge($command, $appinCnf['command']);
				}
			}
		}
		return $command;
	}
}